<script type="text/javascript">	
	function check()
	{
		re=/^\s*$/;
		if(re.test(formsua.tieude.value))
		{
			alert("Tiêu đề không được để trống");
			return false;
		}
	}
	function deleteFile() {
		document.getElementById("tenfile").setAttribute("value"," ");
	}
</script>
<!-- /TinyMCE -->

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <div id="table"> 
     <?
	$id=$_REQUEST["id"];
	$sql="select * from lichcongtac where idlichcongtac = $id";
	$result=mysql_query($sql) or die("Can not query lichcongtac in edit.php");
	while ($row=mysql_fetch_array($result))
	{
?>


<form name="formsua" method="post" action="?go=schedule&action=edit&id=<?=$id?>" onsubmit="return check();" enctype="multipart/form-data"  >
		<table cellpadding="0" cellspacing="0" border="1" align="center" width="100%">
			<tr>
				<td width="20%" align="right" style="padding-right:5px"> Tiêu đề </td>
				<td width="80%" style="padding-left:5px;"> <input type="text" name="tieude" value="<?=$row['tieude']?>" style="width:70%"> </td>
			</tr>
            <tr>
				<td align="right" style="padding-right:5px">Lưu trữ </td>
     			<td style="padding-left:5px;"><input type="file" name="image" title="Định dạng file DOC,DOCX,PDF,XSL,XSLX. Kích thước tối đa 300KB"></td>
			</tr>
            <tr>
            	<td></td>
                <td><input type="text" id="tenfile" name="tenfile"  readonly="readonly" value="<?=$row['luutru']?>" style="width:70%" /></td>
            </tr>
            <tr>
            	<td></td>
            	<td style="padding-left:5px;"><input type="button" value="Xóa File Văn Bản" name="xoafile" onclick="if (confirm('Bạn muốn xóa file ?') == true) {
                deleteFile();
                } else {
                	return false;
                }" /></td>
            </tr>
			<tr>
      			<td align="right" style="padding-right:5px">Trạng thái: </td>
      			<td style="padding-left:5px">
        			<select name="trangthai">
					<?
						if($row['status']==1)
						{
					?>
						<option value="1" selected="selected">Hoạt động</option>
						<option value="0">Không hoạt động</option>
					<?
						}
						else
						{
					?>
						<option value="1">Hoạt động</option>
						<option value="0" selected="selected">Không hoạt động</option>		
					<?
						}
					?>
       			 </select>
      			</td>
    		</tr>
        	<tr>
				<td>&nbsp;  </td>
				<td> <input type="submit" value=" Sửa " name="Submit" /> <input type="button" name="cancel" value=" Quay lại " onClick="location='?go=schedule&action=view&page=1';"/></td>
			</tr>
		</table>
		
</form>
        <?
	}
	echo "</div>";

		?>
<div class="clear"></div>
</div>